package com.example.design.obServerDemo;

public class SportsSubjectObserver extends Observer {


  private Subject subject;

  public SportsSubjectObserver(Subject subject) {
   this.subject=subject;
    this.subject.addObserver(this);
  }

  @Override
  void service() {
    System.out.println("Sports"+subject.getName());
  }

  public void setSubject(Subject subject) {
    this.subject = subject;
  }
}
